from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
from django.urls import reverse
from .doutu import *
# Create your views here.
def index(request):
    
    return render(request,'picture/index.html')
def search(request):
    keyword = request.GET['key_word']
    d = Doutu(keyword)
    img_url_list = d.getimage()
    context = {'key_word':keyword,
               'img':img_url_list}
    
    return render(request,'picture/search.html',context)
